import unittest
from app.helper.audio.audio import Audio
from pydub.playback import play


class TestPath(unittest.TestCase):
    def test_path(self):
        # file_path = "B:\\docker\\language\\python\\src\\projects\\fastapi-audio\\storage\\test\\梅艳芳-女人花.flac"
        # file_path = "B:\\docker\\language\\python\\src\\projects\\fastapi-audio\\storage\\test\\王菲-如愿.mp3"
        # file_path = "B:\\docker\\language\\python\\src\\projects\\fastapi-audio\\storage\\test\\陈淑桦-梦醒时分.mp3"
        # file_path = "B:\\docker\\language\\python\\src\\projects\\fastapi-audio\\storage\\test\\莫文蔚-这世界那么多人.mp3"
        file_path = "B:\\docker\\language\\python\\src\\projects\\fastapi-audio\\storage\\test\\胡兵&希莉娜依-归去来.mp3"
        cover_path = "B:\\docker\\language\\python\\src\\projects\\fastapi-audio\\storage\\test\\logo.png"

        audio = Audio()\
            .from_file(file_path)\
            .export("flac")
            # .set_tags({
            #     'cover': cover_path,
            #     'artist': 'Beesoft',
            #     'album': 'Beesoft album',
            #     'comments': 'Hero\'s favourite songs'
            # })\
            # .export("wav")
        # audio.play()
        # print("channels: %d, frame_rate: %d, sample_width %d"
        #       % (audio.get_channels(), audio.get_frame_rate(), audio.get_sample_width()))
        # wav|flac|mp3|ogg # 可导出
        # aac|wma # 不可导出


if __name__ == '__main__':
    unittest.main()
